<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>请求</button>
</body>
<script>
    console.log(window.location.href);
    document.querySelector('button').addEventListener('click',function(){
        var xhr = new XMLHttpRequest()
        xhr.open('GET','./test.json')
        xhr.send()
        xhr.onload = function(){
            console.log(this);
        }
        console.log(xhr);
    })
</script>
</html>